<?php
/*! \brief
 * This is WFIOFactory class
 * This is the Simple Factory Class that create relative Security Class
 * \author William Su
 */
class WFSecurityFactory
{
    /**
     * @return WF
     */
    private $objFramework;
    private static $instance;
    public function __construct($objFramework){
        $this->objFramework = $objFramework;
    }
    public static function getDirnameFile(){
        if(! isset(self::$instance[__FUNCTION__])){
            self::$instance[__FUNCTION__] = dirname(__FILE__);
        }
        return self::$instance[__FUNCTION__];
    }
    /**
     * @return WFSanitize
     */
    public function getSanitize(){
        if(! isset(self::$instance[__CLASS__][__FUNCTION__])){
            require_once (self::getDirnameFile() . '/Sanitize.php');
            self::$instance[__CLASS__][__FUNCTION__] = new WFSanitize($this->objFramework);
        }
        return self::$instance[__CLASS__][__FUNCTION__];
    }
}